//将消息显示在网页上
function setMessageInnerHTML(nick, msg) {
  var a =
    '<div class="botui-message-left"><div class="botui-message-content shake-constant shake-constant--hover">';

  $("#message").append(
    "<div class='sendUser'><b>" + nick + "</b></div>" + a + msg + b
  );
  scrollToEnd();
  $(".botui-message-content").animate({ "margin-left": "0px" }, 200);
}

//将图片显示在网页上
function setImgInnerHTML(nick, img) {
  var a =
    '<div class="botui-message-left"><div class="botui-message-content shake-constant shake-constant--hover">';

  $("#message").append(
    "<div class='sendUser'><b>" +
      nick +
      "</b></div>" +
      a +
      '<img src="' +
      img +
      '">' +
      b
  );
  scrollToEnd();
  $(".botui-message-content").animate({ "margin-left": "0px" }, 200);
}

//将图片显示在网页上
function setFileInnerHTML(nick, img, filename) {
  var a =
    '<div class="botui-message-left"><div class="botui-message-content shake-constant shake-constant--hover">';

  $("#message").append(
    "<div class='sendUser'><b>" +
      nick +
      "</b></div>" +
      a +
      '<a href="' +
      img +
      '" target="view_window" style="color:blue"> 点击下载:'+filename+'</a>' +
      b
  );
  scrollToEnd();
  $(".botui-message-content").animate({ "margin-left": "0px" }, 200);
}


//将自己发的消息显示在网页上
function setMessageInnerHTML2(nick, msg) {
  var c =
    '<div class="botui-message-right"><div  class="botui-message-content2 shake-constant shake-constant--hover">';

  $("#message").append(
    "<div class='sendUser' style='text-align: right;'><b>" +
      nick +
      "</b></div>" +
      c +
      msg +
      b
  );
  scrollToEnd();
  $(".botui-message-content2").animate({ "margin-right": "0px" }, 200);
}

//将自己发的图片显示在网页上
function setImgInnerHTML2(nick, img) {
  var a =
    '<div class="botui-message-right"><div  class="botui-message-content2 shake-constant shake-constant--hover">';

  $("#message").append(
    "<div class='sendUser'  style='text-align: right;'><b>" +
      nick +
      "</b></div>" +
      a +
      '<img src="' +
      img +
      '">' +
      b
  );

  scrollToEnd();
  $(".botui-message-content2").animate({ "margin-right": "0px" }, 200);
}

  //将自己发的图片显示在网页上
function setFileInnerHTML2(nick, img, filename) {
  var a =
    '<div class="botui-message-right"><div  class="botui-message-content2 shake-constant shake-constant--hover">';

  $("#message").append(
    "<div class='sendUser'  style='text-align: right;'><b>" +
      nick +
      "</b></div>" +
      a +
      '<a href="' +
      img +
      '" target="view_window" style="color:blue">点击下载:'+filename+'</a>' +
      b
  );



  scrollToEnd();
  $(".botui-message-content2").animate({ "margin-right": "0px" }, 200);
}